<openerp>
<data>

    <!--
        Asset Category
     -->

    <record model="ir.ui.view" id="view_account_asset_category_form_bf">
        <field name="name">account.asset.category.form.bf</field>
        <field name="model">account.asset.category</field>
        <field name="inherit_id" ref="account_asset.view_account_asset_category_form"/>
        <field name="arch" type="xml">
        	<field name="method_time" position="replace">
        		<field name="method_time" invisible="1"/>
        	</field>
        	<group string="Depreciation Method" position="replace">
        		<group string="Depreciation Method" invisible="1"/> 
        	</group>
        	<group groups="analytic.group_analytic_accounting" position="replace">
                <group groups="analytic.group_analytic_accounting" invisible="1"/> 
            </group>
        </field>
    </record>

    <!--
        Asset
     -->

    <record model="ir.ui.view" id="view_account_asset_asset_form_bf">
        <field name="name">account.asset.asset.form.bf</field>
        <field name="model">account.asset.asset</field>
        <field name="inherit_id" ref="account_asset.view_account_asset_asset_form"/>
        <field name="arch" type="xml">
        	<button name="open_entries" position="replace">
        		<button class="oe_inline oe_stat_button" name="open_entries"  type="object" icon="fa-pencil" invisible="1"/>
            </button>
        	<button name="set_to_draft" position="replace">
            	<button name="set_to_draft" states="open,close" string="Set to Draft" type="object"/>
            </button>
        	<field name="parent_id" position="replace">
            	<field name="parent_id" invisible="1"/> 
            </field>
            <field name="currency_id" position="replace">
            	<field name="currency_id" groups="base.group_multi_currency" invisible="1"/> 
            </field>
            <field name="salvage_value" position="replace">
            	<field name="salvage_value" widget="monetary" options="{'currency_field': 'currency_id'}" on_change="onchange_purchase_salvage_value(purchase_value, salvage_value)" invisible="1"/>
            </field>
            <field name="partner_id" position="replace">
            	<field name="partner_id" invisible="1"/>
            </field>
            <field name="method" position="replace">
            	<field name="method" invisible="1"/>
            </field>
            <field name="method_time" position="replace">
            	<field name="method_time" invisible="1"/>
            </field>
            <label for="method_time" position="replace">
            	<label for="method_time" invisible="1"/>
            </label>
            <button string="Change Duration" position="replace">
             	<button string="Change Duration" invisible="1"/>
            </button>
            <field name="prorata" position="replace">
            	<field name="prorata" attrs="{'invisible': [('method_time','=','end')]}" invisible="1"/>
            </field>
            
            <button name="compute_depreciation_board" position="replace">
            	<button type="object" name="compute_depreciation_board" string="Compute" icon="terp-stock_format-scientific" colspan="2" attrs="{'invisible':[('state','=','close')]}" invisible="1"/>
            </button>
            
            <xpath expr='//notebook/page[@string="Depreciation Board"]/field[@name="depreciation_line_ids"]' position='replace'>
				<field name="depreciation_line_ids" readonly="1" mode="tree">
					 <tree string="Depreciation Lines" colors="blue:(move_check == False);black:(move_check == True)">
                         <field name="depreciation_date" />
                         <field name="sequence" invisible="1"/>
                         <field name="depreciated_value"/>
                         <field name="amount"/>
                         <field name="remaining_value"/>
                         <field name="move_check"/>
                         <field name="parent_state" invisible="1"/>
                         <button name="create_move" attrs="{'invisible':['|',('move_check','!=',False),('parent_state','!=','open')]}" icon="gtk-execute" string="Create Move" type="object"/>
                     	 <button name="unposted_move" attrs="{'invisible':['|',('move_check','!=',True),('parent_state','!=','open')]}" icon="gtk-execute" string="Unposted" type="object"/>
                     </tree>
                     <form string="Depreciation Lines"> 
                         <group>
                             <group>
                                 <field name="parent_state" invisible="1"/>
                                 <field name="name"/>
                                 <field name="amount"/>
                                 <field name="move_id"/>
                                 <field name="move_check"/>
                                 <field name="parent_state" invisible="1"/>
                             </group>
                             <group>
                                 <field name="sequence"/>
                                 <field name="depreciation_date"/>
                                 <field name="depreciated_value"/>
                                 <field name="remaining_value"/>
                             </group>
                         </group>
                     </form>
				</field>
			</xpath>
		</field>
    </record>
    
    <menuitem action="account_asset.action_asset_depreciation_confirmation_wizard"
            id="menu_asset_depreciation_confirmation_wizard_bf"
            parent="account_asset.menu_finance_assets" 
            sequence="10"/>     
</data>
</openerp>
